import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {HttpClientModule, HTTP_INTERCEPTORS, HttpClient} from '@angular/common/http';
import {
  AppComponent, HomeComponent, LoginComponent,
  LayoutComponent, BreadcrumbComponent, FooterComponent,
  TopbarComponent, MenuComponent, EmptyComponent
} from './dashboard';
import {AppRoutingModule} from './app-routing.module';
import {PrimeNgModule} from './prime-ng.module';

import {PubSubService} from './shared/pub-sub/pub-sub.service';
import {StorageService} from './shared/services/storage.service';

import {AppContextService} from './shared/services/app-context.service';
import {HttpClientService, NoopInterceptor} from './shared/services/http-client.service';
import {ConfirmationService} from 'primeng/api';
import {SharedModule} from './shared/shared.module';
import {UserDialogComponent} from './system-manage/component/user-dialog.component';
import {MarkdownModule} from 'angular2-markdown';
import {BackTopModule} from './vendor/back-top/back-top.component';
import {MyBaiduMapModule} from './vendor/baidu-map/baidu-map.component';
import {LightboxModule} from 'angular2-lightbox';
import {MyLightBoxModule} from './vendor/light-box/light-box.component';

const layoutCom = [HomeComponent, LayoutComponent, TopbarComponent, BreadcrumbComponent, FooterComponent, MenuComponent, EmptyComponent];
const pageCom = [LoginComponent];
@NgModule({
  declarations: [
    AppComponent, // UserDialogComponent,
    layoutCom, pageCom
  ],
  // entryComponents: [ UserDialogComponent ],
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,
    BrowserModule,
    BrowserAnimationsModule, /*只能写在跟模块，动画需要*/
    MarkdownModule.forRoot(),
    AppRoutingModule,
    PrimeNgModule,
    BackTopModule,
    SharedModule,
    MyBaiduMapModule,
    LightboxModule,
    MyLightBoxModule
  ],
  providers: [
    PubSubService, StorageService, AppContextService, ConfirmationService,
    HttpClient, HttpClientService, {provide: HTTP_INTERCEPTORS, useClass: NoopInterceptor, multi: true},
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
